package com.datastructure.test.isPalindString;

public class IsPalindString {
    public static void main(String[] args) {

    }

    public boolean judge (String str) {
        // write code here
        if(str==null){
            return false;
        }
        if(str.length()==1){
            return true;
        }
        int length = str.length();
        int mid = length/2;
        for (int i = 0; i < mid; i++) {
            if(str.charAt(i)!=str.charAt(length-i-1)){
                return false;
            }
        }
        return true;
    }
}
